Skip to content

feat: refactored as_ref_mut.rs to as_ref.rs and as_mut1.rs and add as_mut2.rs#1306

Closed
jtcours wants to merge 1 commit intorust-lang:mainfrom
jtcours:jtcours_20221227
Closed

feat: refactored as_ref_mut.rs to as_ref.rs and as_mut1.rs and add as_mut2.rs#1306
jtcours wants to merge 1 commit intorust-lang:mainfrom
jtcours:jtcours_20221227

Conversation

@jtcours
Copy link
Copy Markdown

@jtcours jtcours commented Dec 27, 2022

While working on exercises/conversions/as_ref_mut.rs, I thought it would be helpful to add an exercise to generalize the num_sq() function to work with any numeric type. The process of making that change gave me a better understanding of the syntax for trait bounds.

The new exercise led to creating "as_mut2.rs", which, in turn, led to refactoring "as_ref_mut.rs" into "as_ref.rs" and "as_mut1.rs".

Apologies in advance for bumping into Frosthage's change (#1113) which updates the hint for "as_ref_mut.rs". This change incorporates the change into "as_mut1.rs" instead.

@mo8it
Copy link
Copy Markdown
Contributor

mo8it commented Apr 13, 2026

I don't think that we should mix in other trait bounds. Users should focus on understanding AsMut in this exercise.

@mo8it mo8it closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants